<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title> API Reference Documentation
        - Class: ErrorSet</title>
    <meta name="MSSmartTagsPreventParsing" content="true" />
    <meta http-equiv="imagetoolbar" content="no" />
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    <link href="css/pygments.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="page">
        <div id="header">
            <h1> API Reference</h1>
        </div>
        <div id="browser">
            <div class="browser-section">
                <h2>Module Index</h2>
                <ul>
                    <li class="active">
                        <a href="formosa.html">formosa</a>
                    </li><li>
                        <a href="formosa.fields.html">formosa.fields</a>
                    </li><li>
                        <a href="formosa.validators.html">formosa.validators</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Methods</h2>
                <ul>
                    <li>
                        <a href="formosa.ErrorSet.html#method-add">add</a>
                    </li><li>
                        <a href="formosa.ErrorSet.html#method-errors">errors</a>
                    </li><li>
                        <a href="formosa.ErrorSet.html#method-errors_for">errors_for</a>
                    </li><li>
                        <a href="formosa.ErrorSet.html#method-has_partial_target">has_partial_target</a>
                    </li><li>
                        <a href="formosa.ErrorSet.html#method-has_target">has_target</a>
                    </li><li>
                        <a href="formosa.ErrorSet.html#method-iter_errors">iter_errors</a>
                    </li><li>
                        <a href="formosa.ErrorSet.html#method-iter_targets">iter_targets</a>
                    </li><li>
                        <a href="formosa.ErrorSet.html#method-sorted_targets">sorted_targets</a>
                    </li><li>
                        <a href="formosa.ErrorSet.html#method-targets">targets</a>
                    </li><li>
                        <a href="formosa.ErrorSet.html#method-targets_for">targets_for</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Attributes</h2>
                <ul>
                    <li>
                        <a href="formosa.ValidationError.html#attribute-args">args</a>
                    </li><li>
                        <a href="formosa.ValidationError.html#attribute-message">message</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
    <h1>Class: ErrorSet</h1>
    <div class="docstring rst"><p>Exception for failed translation of user input.</p>
<p>Instances serve as containers mapping errors to the fields to which they
apply.  An error may be either a simple error message string, or it may be
another <tt class="docutils literal"><span class="pre">ErrorSet</span></tt> instance in the case of nested errors.</p>
<p>Each error (be it a message or an <tt class="docutils literal"><span class="pre">ErrorSet</span></tt> object) is associated with
an iterable of zero or more field names, which is called the <em>target</em>.
While the same error may be mapped to more than target, an error may be
mapped to the same target only once.  The order in which field names are
given is insignificant.</p>
</div>
    <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
    <div>
        <h2>Methods</h2>
            <h3 id="method-add">
                add
                <span class="args">(self, error, target=None)</span>
            </h3>
            <div class="docstring rst"><p>Associate an error with the given iterable of target field names.
Ignore the order of the field names.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-errors">
                errors
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"><p>Return all errors that have been added to the collection.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-errors_for">
                errors_for
                <span class="args">(self, target)</span>
            </h3>
            <div class="docstring rst"><p>Return a set of errors that have been assigned to <tt class="docutils literal"><span class="pre">target</span></tt>, an
iterable of field names whose order is insignificant.  Raise
<tt class="docutils literal"><span class="pre">KeyError</span></tt> if no errors have been assigned.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-has_partial_target">
                has_partial_target
                <span class="args">(self, target)</span>
            </h3>
            <div class="docstring rst"><p>Return whether the given iterable of field names forms an improper
subset of any target.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-has_target">
                has_target
                <span class="args">(self, target)</span>
            </h3>
            <div class="docstring rst"><p>Return whether an error has been assigned to the given iterable of
field names.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-iter_errors">
                iter_errors
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"><p>Iterate over the errors that have been added to the collection.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-iter_targets">
                iter_targets
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"><p>Yield each target to which an error has been assigned.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-sorted_targets">
                sorted_targets
                <span class="args">(self, field_order)</span>
            </h3>
            <div class="docstring rst"><p>Return the error set's targets sorted primarily by the number of
fields in the target, and then by the position of the first field in
each target list as indicated by <tt class="docutils literal"><span class="pre">field_order</span></tt>.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-targets">
                targets
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"><p>Return the set of targets to which errors have been assigned.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-targets_for">
                targets_for
                <span class="args">(self, error)</span>
            </h3>
            <div class="docstring rst"><p>Return a set of targets to which <tt class="docutils literal"><span class="pre">error</span></tt> has been assigned.
Raise <tt class="docutils literal"><span class="pre">KeyError</span></tt> if no such error has been added.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
    </div>
    <div>
        <h2>Attributes</h2>
            <h3 id="attribute-args">args</h3>
            <div class="docstring rst"></div>
            <h4>Value of args</h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="attribute-message">message</h3>
            <div class="docstring rst"></div>
            <h4>Value of message</h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
    </div>
        </div>
        <div id="footer">
            Generated with <a href="http://apydia.ematia.de/" class="extern">
            Apydia 0.0.2</a> on 2008-11-26 11:09
        </div>
    </div>
</body>
</html>